/**
 * Created by wenchuan.li on 2018/5/16.
 */
define(function () {

    var self,
        app = win.app,
        user
    ;

    var Me = app.Module.extend({

        init: function () {
            self = this;
            var sysuser=app.userInfos.sysUser;
            user =  {
                'GWAA02': sysuser.NAME,
                'GWAA01': sysuser.ACCOUNT,
                'useravatar': app.cookie('_WX_AVATAR_') || '../../../img/wx/user.png',
            };
            self._super({}, win);
        },
        _lazy: function () {
            this._super();
            require(['wx-iconfont'], $.noop);
            mui('.mui-scroll-wrapper').scroll({
                deceleration: 0.0005
            });
        },
        _ready: function () {

            new Vue({
                el: app.getByid(doc, 'mainPage3'),
                data: {
                    item: user || {},
                    auths: self._pageParameters.auths
                },
                methods: {
                    // clearDataCache:function () {
                    //     app.lStorage.removeAll();
                    //     mui.toast('清理完成');
                    // },
                    userinfo:function () {
                       app.openPage({
                           src:'me/userinfo.html'
                       });
                    },
                    openWindow: function (code_, url_) {
                        if (code_ == 'wx0006') {//购物车下单
                            delete app.pageParameters['classes_page'];
                        }

                        app.openPage({
                            src: url_ + '.html'
                        });
                    },
                }
            });
        }
    });

    return new Me();

});